<!DOCTYPE html>
<html>
<head>
<title>上传<?php echo $cInfos['typename']; ?>- 会员中心 -<?php echo $cfg_webname; ?></title>
<!--公共样式-->
<!-- <link rel="stylesheet" type="text/css" href="/css/com/base_v2.7.css"> -->
<link rel="stylesheet" type="text/css" href="/revision/iconfont/iconfont.css" />
<link href="/revision/css/login/login.css" rel="stylesheet" />
<!--页面css-->
<link rel="stylesheet" type="text/css" href="/revision/css/base/reset.css" />
<link rel="stylesheet" type="text/css" href="/revision/css/base/public_v6.css?v20170904" />
<link rel="stylesheet" type="text/css" href="/revision/css/user/user_v2.css" />
<link rel="stylesheet" type="text/css" href="/revision/css/classify/multimedia_v2.css" />
<!--head内js-->

<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" src="templets/js/inputAutoClear.js"></script>
<script type="text/javascript" src="templets/js/load.js"></script>



<script src="/revision/js/jquery.js"></script>
<script type="text/javascript" src="upface/ajaxupload.3.5.js"></script>
<script language="javascript" type="text/javascript" src="/include/dedeajax2.js"></script>
<script language="javascript" type="text/javascript">
<!--
	function CheckLogin(){
	  var taget_obj = document.getElementById('_userlogin');
	  myajax = new DedeAjax(taget_obj,false,false,'','','');
	  myajax.SendGet2("/member/ajax_loginsta.php");
	  DedeXHTTP = null;
	}
	function CheckLogin1(){
	  var taget_obj = document.getElementById('_userlogin1');
	  myajax = new DedeAjax(taget_obj,false,false,'','','');
	  myajax.SendGet2("/member/ajax_loginsta.php");
	  DedeXHTTP = null;
	}
-->
</script>
<style type="text/css">
<!--
.setting-wrap .user-info {
    padding: 15px 20px;
}
.setting-wrap .user-info .set-box {
    font-size: 14px;
}
.set-main .set-box {
    padding-bottom: 20px;
}
.setting-wrap .user-info .box-title, .setting-wrap .user-info .nav-list {
    vertical-align: initial;
}
.set-main .set-box .box-title {
    width: 60px;
    text-align: right;
    font-size: 14px;
}
.set-main .set-box .box-title, .set-main .set-nav .nav-list {
    vertical-align: middle;
    margin-right: 20px;
    display: inline-block;
}
label {
    border: 0;
    font: inherit;
    vertical-align: baseline;
    text-align: left;
    font-family: "Microsoft YaHei";
    margin: 0;
    padding: 0;
    color: #333;
}
.setting-wrap .user-info input[type=text], .setting-wrap .user-info select, .setting-wrap .user-info textarea {
    border-radius: 4px;
    color: #b2b2b2;
}
.set-main .set-box input[type=text], .set-main .set-box select {
    width: 400px;
    height: 36px;
    line-height: 36px;
    padding: 6px 0 6px 10px;
}
.set-main .set-box input[type=text], .set-main .set-box select, .set-main .set-box textarea {
    border: 1px solid #dedede;
    resize: none;
    font-size: 14px;
    color: #333;
}
.setting-wrap .user-info .set-box {
    font-size: 14px;
}
.set-main .set-box {
    padding-bottom: 0px; border-bottom: 1px solid #dedede;height:80px; line-height:80px;
}
.set-main .set-box .radio-inline {
    display: inline-block;
}
[type=radio]:checked, [type=radio]:not(:checked) {
    position: absolute;
    left: -9999px;
    opacity: 0;
}
form, input, textarea {
    font-family: "Microsoft YaHei";
    outline: 0;
}
* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
user agent stylesheet
input[type="radio" i] {
    margin: 3px 3px 0px 5px;
}
user agent stylesheet
input[type="radio" i] {
    -webkit-appearance: radio;
    box-sizing: border-box;
}
user agent stylesheet
input[type="radio" i], input[type="checkbox" i] {
    background-color: initial;
    margin: 3px 0.5ex;
    padding: initial;
    border: initial;
}
.set-main .set-box input[type=text], .set-main .set-box select, .set-main .set-box textarea {
    border: 1px solid #dedede;
    resize: none;
    font-size: 14px;
    color: #333;
}

.imgfile-box {
    width: 60px;
    height: 60px;
    margin: 5px;
    overflow: hidden;
    vertical-align: middle;
    background: url(http://img.3d66.com/webimages/icon-img.png) no-repeat;
    position: relative; float:left
}

.table-user input {
    border: none;
}

.imgfile-box input {
    position: absolute;
    left: 0;
    top: 0;
}
.imgfile, .zipfile {
    width: 60px;
    height: 60px;
    cursor: pointer;
    opacity: 0;
    filter: alpha(opacity=0);
}
input, textarea {
    font-family: "Microsoft Yahei", Helvetica, Arial, sans-serif;
    outline: none;
}
.zipfile-box {
    display: inline-block;
    width: 60px;
    height: 60px;
    margin: 5px;
    overflow: hidden;
    vertical-align: middle;
    background: url(http://img.3d66.com/webimages/icon-file.png) no-repeat; float:left;
}
.img-preview{
	display: inline-block;
	vertical-align: middle;
}
.img-preview div{
	position: relative;
	display: inline-block;
}
.img-preview div img{
	width: 60px;
	height: 60px;
	margin: 5px;
	vertical-align: middle;display: inline-block;
}

.del-img {
    position: absolute;
    right: 5px;
    top: 5px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7F000000,endColorstr=#7F000000);
    font-size: 10px;
    line-height: 10px;
    color: #fff;
    padding: 1px 3px 3px 3px;
}
.file-change {
    background: url(http://img.3d66.com/webimages/upload-file.jpg) no-repeat;
}
.fabuanniu {
    display: inline-block;
    width: 116px;
    height: 32px;
    line-height: 31px;
    margin: 20px 0;
    text-align: center;
    font-size: 16px;
    color: #fff;
    text-indent: 7px;
    letter-spacing: 4px;
    -webkit-border-radius: 16px;
    border-radius: 16px;
    background: -webkit-gradient(linear,left top,right top,from(#ffae12),to(#f07d17));
    background: -webkit-linear-gradient(left,#ffae12,#f07d17);
    background: -o-linear-gradient(left,#ffae12,#f07d17);
    background: linear-gradient(to right,#ffae12,#f07d17);
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<!--低版本提示-->
<!--[if lte IE 9]><style type="text/css">*{ margin: 0; padding: 0;}.topTip{width: 100%;position:fixed; left:0;z-index:99;height: 40px;background: #808080;opacity: 0.5;filter:alpha(opacity=50);    top:0;text-align: center;color: #fff;font: 16px "微软雅黑";line-height: 40px;}</style><div class="topTip">您当前浏览器版本过低，建议使用谷歌或火狐浏览器</div><![endif]-->
<!--公共头-->
<!--公用悬浮头部/搜索页头部-->
<?php pasterTempletDiy("default/headuser.htm"); ?>
<script src="/revision/js/header/search.v2.js?20170901"></script>
<div class="bt-body">
  <div class="user-body-left gradient-ver-og">
    <?php include(DEDEMEMBER."/templets/left.php"); ?>
  </div>
  <div class="user-body-right p-vip">
    <nav class="tab-list">
      <p style=" float:left;color:#999; font-weight:bold;">选择素材类型：</p>
      <a href="fabu.php?channel=7" <?php echo ($channel=='')? "class='active'" : "";?>>全部</a> <a href="fabu.php?channel=7" <?php echo ($channel=='7')? "class='active'" : "";?>>广告素材</a> <a href="fabu.php?channel=8" <?php echo ($channel=='8')? "class='active'" : "";?>>视频模板</a> <a href="fabu.php?channel=9" <?php echo ($channel=='9')? "class='active'" : "";?>>PPT模板</a> <a href="fabu.php?channel=10" <?php echo ($channel=='10')? "class='active'" : "";?>>Word模板</a> <a href="fabu.php?channel=11" <?php echo ($channel=='11')? "class='active'" : "";?>>Excel模板</a> </nav>
    <div class="bt-list ad-list">
      <!--fabustar-->
      <form class="mTB10 mR10 mL10" name="form1" action="fabu.php" method="post" enctype="multipart/form-data" onSubmit="return checkSubmit();">
        <input type="hidden" name="dopost" value="save" />
        <input type="hidden" name="channelid" value="<?php echo $channelid; ?>" />
		<input type="hidden" name="wode" value="<?php echo $cfg_ml->M_UserName?>" />
        <input name="softurl1" type="hidden" id="softurl1" class="intxt" style="width:230px" />
        <input name="servermsg1" type="hidden" id="servermsg1" value="本地下载" class="intxt" style="width:150px" />
        <input type="hidden" id="litpics" name="addlitpic" value="" />
        <div class="list-main set-main user-info" style="display: block;">
        <div class="set-box">
          <label class="box-title">素材名称</label>
          <input type="text" name="title" value="">
        </div>
        <div class="set-box job_type">
          <label class="box-title">所属栏目</label>
          <?php
    			 $typeOptions = GetOptionList(0,$channelid);
    			 echo "<select name='typeid'>\r\n";
				 echo "<option value='0'>请选择栏目</option>\r\n";
				 echo $typeOptions;
				 echo "</select>";
			  ?>
        </div>
        <!---主图-->
        <div class="set-box">
          <label class="box-title" >素材主图</label>
          <div style="width:670px; float:right;padding: 5px 5px;line-height: 20px;">
            <div class="imgfile-box" id="upload_button">
              <input type="file" accept="image/jpg,image/jpeg,image/png" class="imgfile">
              <img src="" id="litpic"  width="60" style=" display:none" ></div>
            <p class="zhututishi"  style="height:70px; line-height:70px; margin-left:100px;color: #ff8a00;"></p>
          </div>
        </div>
        <!---多图-->
        <div class="set-box" style="height:auto;">
          <label class="box-title" >效果多图</label>
          <div style="width:670px; float:right;padding: 5px 5px;line-height: 20px;">
            <div class="img-preview">
              <div class="shiwo"> </div>
              <div class="imgfile-box">
                <div id="uploadBtnHolder" class="imgfile"></div>
              </div>
            </div>
            <p class="progresschenggong"  style="height:70px; line-height:70px; margin-left:100px;color: #ff8a00; float:right;"></p>
          </div>
        </div>
        <!---文件-->
        <div class="set-box">
          <label class="box-title">素材文件</label>
          <div style="width:670px; float:right;padding: 5px 5px;line-height: 20px;">
            <div class="zipfile-box" id="wenjian"> </div>
            <p class="wenjiantishi"  style="height:70px; line-height:70px; margin-left:100px;color: #ff8a00;"></p>
          </div>
        </div>
        <?php
           //自定义字段
           PrintAutoFieldsAdd($cInfos['fieldset'],'autofield');
           ?>
        <div class="set-box" style="height:70px; line-height:70px;"><label class="box-title style=" float:left;""="">素材售价</label>
   <div style="width:660px; float:right;">
       <input type="text" name="needmoney" id="needmoney" style="width:80px" class="intxt" value=""><span style=" margin-left:40px;color: #999;">如果免费请填写0</span>

   </div>
</div>
		<div class="set-box"  style="height:300px; line-height:300px;">
          <label class="box-title" style="line-height:300px; height:300px;">素材详情</label>
          <div style="width:670px; float:right;height:280px; line-height:280px; padding:10px 10px;">
            <textarea title="" style="width: 670px;height: 280px;line-height: 20px; overflow:hidden;" class="inputtext" name="body"></textarea>
          </div>
        </div>
        <div style=" width:116px; margin:0 auto;">
          <button class="fabuanniu" type="submit">确认发布</button>
        </div>
      </form>
      <!--fabuesd-->
    </div>
  </div>
</div>
</div>
<script type="text/javascript" src="/revision/js/user/user.js" ></script>
<?php pasterTempletDiy("default/footer.htm"); ?>
<!-- 上传必备插件 -->
<script type="text/javascript" src="templets/js/plugin/swfupload/swfupload.js"></script>
<script type="text/javascript" src="templets/js/plugin/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="templets/js/plugin/swfupload/swfupload.speed.js"></script>
<script type="text/javascript" src="templets/js/plugin/swfupload/handlers.js"></script>
<script type="text/javascript">
			function updateProgress(file) {
				$('.progress .bar').css('width', parseInt(file.percentUploaded) + '%');
				$('.progresschenggong').html(SWFUpload.speed.formatPercent(file.percentUploaded));
			}

			function initProgress() {
				$('.progress').show();
				$('.progress .bar').css('width', '0%');
				$('.progress .text').html('0%');
			}

			function successAction(fileInfo) {
				setUploadImage(fileInfo);
				// 如果上传完成了
				$('.progress-box').hide();
			}

			function setUploadImage(fileInfo) {
				var up_path = fileInfo.path;
				var up_width = fileInfo.width;
				var up_height = fileInfo.height;
                var up_name = fileInfo.name;

				var listEls = $('.img-preview');
				var innerHtml =
				'<div>'+
					'<input type="hidden" name="bigfile_info[]" id="pic" value="' + up_path + '">'+
					'<img src="' + up_path + '" />'+
					'<p class="del-img" title="删除">x</p>'+
				'</div>';listEls.find('.shiwo').append(innerHtml);
				initImageListFn();
			}

			function initImageListFn() {
				$(".shiwo div p.del-img").click(function(){
						var name = $(this).parent('div').find("#pic").attr("value");
						var mythis = $(this);
						//alert(mythis)
						$.ajax({
                            type: "POST",
                            url: "delpic.php",
                            data: "name=" + name,
                            dataType:'json',
                            success: function(msg) {
                                $(mythis).parent('div').remove();
							}
						});
				});

			}

			var swfImageUpload;
			$(document).ready(function() {
				var settings = {
					flash_url : "templets/js/plugin/swfupload/swfupload.swf",
					flash9_url : "templets/js/plugin/swfupload/swfupload_fp9.swf",
					upload_url: "upload.php",// 接受上传的地址
					file_size_limit : "2 MB",// 文件大小限制
					file_types : "*.jpg;*.gif;*.png;*.jpeg;",// 限制文件类型
					file_types_description : "Image Files",// 说明，自己定义
					file_upload_limit : 6,
					file_queue_limit : 0,
					custom_settings : {},
					debug: false,
					// Button settings
					button_image_url: "",
					button_width: "60",
					button_height: "60 ",
					button_placeholder_id: 'uploadBtnHolder',
					button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,
					button_cursor : SWFUpload.CURSOR.HAND,
					button_action: SWFUpload.BUTTON_ACTION.SELECT_FILE,

					moving_average_history_size: 40,

					// The event handler functions are defined in handlers.js
					swfupload_preload_handler : preLoad,
					swfupload_load_failed_handler : loadFailed,
					file_queued_handler : fileQueued,
					file_dialog_complete_handler: fileDialogComplete,
					upload_start_handler : function (file) {
						initProgress();
						updateProgress(file);
					},
					upload_progress_handler : function(file, bytesComplete, bytesTotal) {
						updateProgress(file);
					},
					upload_success_handler : function(file, data, response) {
						// 上传成功后处理函数
                        successAction(JSON.parse(data));
					},
					upload_error_handler : function(file, errorCode, message) {
						alert('为了节省空间服务器只允许最多上传6张！');
					},
					file_queue_error_handler : function(file, errorCode, message) {
						if(errorCode == -110) {
							alert('您选择的文件太大了。');
						}
					}
				};
				swfImageUpload = new SWFUpload(settings);
				initImageListFn();
			});
			</script>
<script type="text/javascript">
$(document).ready(function(){
    ajaxUpload(
		'upload_button', 
        2048,  
        'upface/upload.php?form_name=userfile&file_size=2048&type=pic&mid=<?php echo $cfg_ml->M_ID;?>', 
        'userfile', 
        "$('#litpic').show();$('#litpics').attr('value', obj.filename);$('#litpic').attr('src', obj.filename);$('.zhututishi').text('主图上传成功，如果需要重新上传直接点击图片');", 
        'loadimg' 
    );
	ajaxUploadwj(
		'wenjian', 
        20480,  
        'upface/upload.php?form_name=userfile&file_size=20480&type=wenjian&mid=<?php echo $cfg_ml->M_ID;?>', 
        'userfile',
        "$('#servermsg1').attr('value', obj.filename);$('.zipfile-box').addClass('file-change');$('.wenjiantishi').text('文件上传成功，如果需要重新上传直接点击图片');",
        'loadimg'

    );
});
</script>
<script type="text/javascript" src="templets/js/ajaxaddup.js"></script>
</body>
</html>
